<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章编辑</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
    <style>
        :root {
            --primary: #6366f1;
            --primary-light: #818cf8;
            --dark: #0f172a;
            --light: #f8fafc;
            --card: #ffffff;
            --text: #1e293b;
            --text-light: #64748b;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background-color: var(--light);
            color: var(--text);
            min-height: 100vh;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }
        
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2.5rem;
        }
        
        .header h1 {
            font-size: 1.875rem;
            font-weight: 700;
            color: var(--dark);
        }
        
        .btn {
            padding: 0.875rem 1.5rem;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.2s;
        }
        
        .btn:hover {
            background: var(--primary-light);
            transform: translateY(-2px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        
        .editor-card {
            background: var(--card);
            border-radius: 1rem;
            padding: 2rem;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        
        .form-group {
            margin-bottom: 1.5rem;
        }
        
        label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text);
        }
        
        input, select {
            width: 100%;
            padding: 1rem;
            border: 1px solid #e2e8f0;
            border-radius: 0.75rem;
            font-size: 1rem;
            transition: all 0.2s;
            background: var(--light);
        }
        
        input:focus, select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
        }
        
        .editor-footer {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            margin-top: 2rem;
        }
        
        .secondary-btn {
            background: none;
            color: var(--text-light);
            border: 1px solid #e2e8f0;
        }
        
        .secondary-btn:hover {
            background: #f1f5f9;
            transform: translateY(-2px);
        }
        
        .EasyMDEContainer {
            border-radius: 0.75rem;
            overflow: hidden;
        }
        
        .editor-statusbar {
            border-bottom-left-radius: 0.75rem;
            border-bottom-right-radius: 0.75rem;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>编辑文章</h1>
            <a href="articles.html" class="btn secondary-btn">
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <line x1="19" y1="12" x2="5" y2="12"></line>
                    <polyline points="12 19 5 12 12 5"></polyline>
                </svg>
                返回列表
            </a>
        </div>
        
        <div class="editor-card">
            <div class="form-group">
                <label for="title">文章标题</label>
                <input type="text" id="title" placeholder="输入文章标题">
            </div>
            
            <div class="form-group">
                <label for="category">分类</label>
                <select id="category">
                    <option value="">选择分类</option>
                    <option value="前端开发">前端开发</option>
                    <option value="性能优化">性能优化</option>
                    <option value="CSS">CSS</option>
                    <option value="安全">安全</option>
                </select>
            </div>
            
            <div class="form-group">
                <label for="editor">内容</label>
                <textarea id="editor"></textarea>
            </div>
            
            <div class="editor-footer">
                <button class="btn secondary-btn">取消</button>
                <button class="btn">保存草稿</button>
                <button class="btn">发布文章</button>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
    <script>
        const easyMDE = new EasyMDE({
            element: document.getElementById('editor'),
            spellChecker: false,
            autosave: {
                enabled: true,
                uniqueId: "kbEditor",
                delay: 1000,
            },
            placeholder: "使用Markdown格式编写文章内容...",
            hideIcons: ["side-by-side", "fullscreen"],
            showIcons: ["code", "table"],
            status: false,
        });
    </script>
</body>
</html>